package com.amp.cloud.rabbit.controller;

import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessagePostProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: TestController
 * @Desc: TODO
 * @Auther: <Bang>
 * @Date: 2020/08/25 14:32
 * @Version: 1.0
 * @Modified By:
 */
@RestController
public class TestController {

    @Autowired
    private AmqpTemplate amqpTemplate;

    @RequestMapping("/test")
    public String test() {
        amqpTemplate.convertAndSend("test.exchange", "test.route", "hello");
        return "hello";
    }
}
